<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>公告列表</title>
	
	<script type="text/javascript"
		src="../static/assets/jquery/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="../static/js/common.js"></script>
	
	<script type="text/javascript">
	
		 function del(url){
			if(confirm('您确定要删除该公告的信息？')) {
				
				$.get(url, function(data) {
					alert(data.msg);
					location.reload();
				});
				//location.href = url;
			}
		 }
	</script>
</head>
<body>

	<form name="searchForm" action="/admin/post/search" method="post">
	
		<div><span>
		
		公告标题<input type="text" name="title" id="title" value="${searchTitle}" ></input>&nbsp;&nbsp;
		公告作者
		<select name="author">
			<option value="-1">请选择管理员</option> 
			<#list authors as aut> 
				<#if aut.account== searchAuthor>
					<option value="${aut.account}" selected="selected">${aut.account}</option>
				<#else>
					<option value="${aut.account}">${aut.account}</option> 
				</#if> 
			</#list>
		</select>
				<input type="submit" name="subButton"
					id="subButton" value="查询" />		
		</span>
		
		</div>
		
	</form>

	<style>
		table {
			width: 100%;
		}
		
		th {
			height:25px;
			line-height:25px;
		}
		
		td{
			line-height:25px;
		}
	</style>
	
	
	<div>公告信息</div>
	<table border="1" cellspacing="0" cellpadding="0" >
		<thead>
			<th>公告标题</th>
			<th>公告内容</th>
			<th>公告作者</th>
		</thead>
		<tbody>
			<#list postList.list as post>
			<tr>
				<td>${post.title}</td>
				<td>${post.content}</td> 
				<td>${post.author}</td>
				<td>&nbsp;&nbsp;&nbsp;<a
					href="/admin/post/edit/${post.id}">编辑</a>
					&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)"
					onclick="del('/admin/post/delete/${post.id}')">删除</a>
				</td>
			</tr>
			</#list>
		</tbody>
	</table>
	

	<div>
		<span style="margin-left: 10px"> 
		总共记录 ：${postList.totalRow} 条；共${postList.totalPage} 页；第 ${postList.pageNumber} 页； 
		<a href="/admin/post/?p=1<#if searchPage == 1>&s=1</#if>" >[首页]</a>
		<a href="/admin/post/?p=<#if postList.pageNumber lte 1>1<#else>${postList.pageNumber - 1}</#if><#if searchPage == 1>&s=1</#if>" >[上一页]</a> 
		<a href="/admin/post/?p=<#if postList.pageNumber gte postList.totalPage>${postList.totalPage}<#else>${postList.pageNumber + 1}</#if><#if searchPage == 1>&s=1</#if>" >[下一页]</a> 
		<a href="/admin/post/?p=${postList.totalPage}<#if searchPage == 1>&s=1</#if>" >[末页]</a>
		每页显示${postList.pageSize}条数据 
		</span>
	</div>

</body>
</html>